﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Entities;

namespace Niti.OrderManage.OrderManage
{
    /// <summary>
    /// 商品
    /// </summary>
    public class Commodity : Entity<int>, ISoftDelete
    {
        /// <summary>
        /// 商品唯一编号
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string CName { get; set; }
        /// <summary>
        /// 商品单价
        /// </summary>

        public float CPrice { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? DeleteTime { get; set; }
        /// <summary>
        /// 库存数量
        /// </summary>
        public int Count { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;


        protected Commodity()
        {

        }

        public Commodity(string code, string cname, float cprice)
        {
            Check.NotNull(code, nameof(code));
            Code = code;
            CName = cname;
            CPrice = cprice;
        }

    }
}
